<template>
  <div class="app">
    <h1>App组件的count：{{ count }}</h1>
    <button @click="count++">+1</button>
    <Children></Children>
  </div>
</template>

<script>
import {provide, ref} from "vue"
import Children from "@/components/Children.vue";

export default {
  name: 'App',
  components: {Children},
  setup(props, context) {
    const count = ref(0)

    // provide(/* 注入名 */ 'message', /* 值 */ 'hello!')
    provide('count', count)
    return {
      count,
    }
  }
}
</script>

<style lang="less"></style>
